package es.osoco.basicpomodoro;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class AddDuration extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.add_duration);
        
        Button button = (Button) findViewById(R.id.submitButton);
        button.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				EditText editText = (EditText) findViewById(R.id.editText);
				
				Intent intent = new Intent();
				intent.putExtra("TIME", Long.parseLong(editText.getText().toString()));				
				setResult(Activity.RESULT_OK,intent);
				finish();
			}
		});
    }
}
